package com.ciwong.epaper.modules.epaper.lsdao;

import com.ciwong.mobilelib.i.BaseCallBack;

/**
 * 听说模考口头作文题评测dao
 *
 * @author sugy
 * @version ciwong v.1.0 2015/11/18 18:14
 * @since ciwong v.1.0
 */
public class LSDao {

    private static LSDao instance;

    private LSDao() {

    }

    /**
     * 获取唯一实例
     *
     * @return 唯一实例
     */
    public static LSDao getInstance() {
        if (instance == null) {
            syncInit();
        }
        return instance;
    }

    /**
     * 实例化对象
     */
    private static synchronized void syncInit() {
        if (instance == null) {
            instance = new LSDao();
        }
    }

    /**
     * 创建session
     *
     * @param json
     * @param callBack
     */
//    public void createSession(final String json, final LSCallBack callBack)
//    {
//        LSRequest.createSession(json, callBack);
//    }

    /**
     * 停止session
     *
     * @param cookie
     *            cookie
     * @param sessionId
     *            session id
     * @param callBack
     *            回调
     */
//    public void stopSession(String cookie, String sessionId,final BaseCallBack callBack)
//    {
//        LSRequest.stopSession(cookie, sessionId, callBack);
//    }

    /**
     * 获取评测结果
     *
     * @param cookie    cookie
     * @param sessionId session id
     * @param callBack  回调
     */
//    public void getResult(String cookie, String sessionId, final BaseCallBack callBack) {
//        LSRequest.getResult(cookie, sessionId, callBack);
//    }

    /**
     * 评测上传文件
     *
     * @param cookie    cookie
     * @param sessionId 会话ID
     * @param index     下标
     * @param bytes     字节数组
     * @param tag       上传标记
     * @param callBack  回调
     */
//    public void uploadAudio(String cookie, String sessionId, int index,byte[] bytes, Object tag, BaseCallBack callBack) {
//        LSRequest.uploadAudio(cookie, sessionId, index, bytes, tag, callBack);
//    }

    /**
     * 释放资源
     */
    public void release() {
        instance = null;
    }
}
